<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/css/style.css' />
  </head>
  <body>
    <header>
        <h1><%= title %></h1>
    </header>
    <span>
        <form action="/search" method="GET">
            <input type="text" name="keyword" placeholder="SEARCH" class="search" />
            <input type="submit" value="搜索"/>
        </form>
    </span>
    <nav>
        <span><a title="主页" href="/">home</a></span>
        <span><a title="存档" href="/archive">archive</a></span>
        <span><a title="标签" href="/tags">tags</a></span>
        <% if (user) { %>
          <span><a title="上传" href="/upload">upload</a></span>
          <span><a title="发表" href="/post">post</a></span>
          <span><a title="登出" href="/logout">logout</a></span>
        <% } else { %>
          <span><a title="登录" href="/login">login</a></span>
          <span><a title="注册" href="/reg">register</a></span>
        <% } %>
    </nav>
    <article>
    <% if (success) { %>
      <div><%= success %></div>
    <% } %>
    <% if (error){ %>
      <div><%= error %> </div>
    <% } %>